package com.app.login.service.impl;

import com.app.login.dao.LoginDao;
import com.app.login.model.Login;
import com.app.login.service.LoginService;
import com.app.sysmodule.exception.ServiceException;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by song on 2018/1/9.
 */
public class LoginServiceImpl implements LoginService {
    @Autowired
    private LoginDao loginDao;
    public boolean verification(String username, String password) throws ServiceException {
        boolean flag = false;
        try{
            Login login = loginDao.getUser(username,password);
            if(null != login){
                return true;
            }
        }catch (Exception e){
            throw new ServiceException(e.getMessage());
        }
        return flag;
    }
}
